<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * LiteCommerce
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to licensing@litecommerce.com so we can send you a copy immediately.
 *
 * @category   LiteCommerce
 * @package    XLite
 * @subpackage Model_Proxy
 * @author     Creative Development LLC <info@cdev.ru>
 * @copyright  Copyright (c) 2011 Creative Development LLC <info@cdev.ru>. All rights reserved
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link       http://www.litecommerce.com/
 * @see        ____file_see____
 * @since      1.0.0
 */

namespace XLite\Model\Proxy;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE
 *
 * @package    XLite
 * @see        ____class_see____
 * @since      1.0.0
 */
class XLiteModelCartProxy extends \XLite\Model\Cart implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * _entityClass
     *
     * @var    string
     * @access protected
     * @see    ____var_see____
     * @since  1.0.0
     */
    protected $_entityClass;

    /**
     * _entityPersister
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_entityPersister;

    /**
     * _identifier
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_identifier;

    /**
     * __isInitialized__
     *
     * @var    mixed
     * @access public
     * @see    ____var_see____
     * @since  1.0.0
     */
    public $__isInitialized__ = false;

    /**
     * __construct
     *
     * @param mixed $entityPersister ____param_comment____
     * @param mixed $identifier      ____param_comment____
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
        $this->_entityClass = 'XLite\Model\Cart';
    }

    /**
     * _load
     *
     * @return void
     * @access private
     * @see    ____func_see____
     * @since  1.0.0
     */
    private function _load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                return;
            }
            unset($this->_entityPersister);
            unset($this->_identifier);
        }
    }

    
    public function prepareBeforeSave()
    {
        $this->_load();
        return parent::prepareBeforeSave();
    }

    public function clear()
    {
        $this->_load();
        return parent::clear();
    }

    public function isProductAdded($productId)
    {
        $this->_load();
        return parent::isProductAdded($productId);
    }

    public function prepareBeforeRemove()
    {
        $this->_load();
        return parent::prepareBeforeRemove();
    }

    public function markAsOrder()
    {
        $this->_load();
        return parent::markAsOrder();
    }

    public function checkCart()
    {
        $this->_load();
        return parent::checkCart();
    }

    public function getOrderId()
    {
        $this->_load();
        return parent::getOrderId();
    }

    public function setShippingId($shippingId)
    {
        $this->_load();
        return parent::setShippingId($shippingId);
    }

    public function getShippingId()
    {
        $this->_load();
        return parent::getShippingId();
    }

    public function setShippingMethodName($shippingMethodName)
    {
        $this->_load();
        return parent::setShippingMethodName($shippingMethodName);
    }

    public function getShippingMethodName()
    {
        $this->_load();
        return parent::getShippingMethodName();
    }

    public function setTracking($tracking)
    {
        $this->_load();
        return parent::setTracking($tracking);
    }

    public function getTracking()
    {
        $this->_load();
        return parent::getTracking();
    }

    public function setDate($date)
    {
        $this->_load();
        return parent::setDate($date);
    }

    public function getDate()
    {
        $this->_load();
        return parent::getDate();
    }

    public function getStatus()
    {
        $this->_load();
        return parent::getStatus();
    }

    public function setNotes($notes)
    {
        $this->_load();
        return parent::setNotes($notes);
    }

    public function getNotes()
    {
        $this->_load();
        return parent::getNotes();
    }

    public function setTotal($total)
    {
        $this->_load();
        return parent::setTotal($total);
    }

    public function getTotal()
    {
        $this->_load();
        return parent::getTotal();
    }

    public function setSubtotal($subtotal)
    {
        $this->_load();
        return parent::setSubtotal($subtotal);
    }

    public function getSubtotal()
    {
        $this->_load();
        return parent::getSubtotal();
    }

    public function getProfile()
    {
        $this->_load();
        return parent::getProfile();
    }

    public function addDetails(\XLite\Model\OrderDetail $details)
    {
        $this->_load();
        return parent::addDetails($details);
    }

    public function getDetails()
    {
        $this->_load();
        return parent::getDetails();
    }

    public function addItems(\XLite\Model\OrderItem $items)
    {
        $this->_load();
        return parent::addItems($items);
    }

    public function getItems()
    {
        $this->_load();
        return parent::getItems();
    }

    public function addSurcharges(\XLite\Model\Order\Surcharge $surcharges)
    {
        $this->_load();
        return parent::addSurcharges($surcharges);
    }

    public function getSurcharges()
    {
        $this->_load();
        return parent::getSurcharges();
    }

    public function addPaymentTransactions(\XLite\Model\Payment\Transaction $paymentTransactions)
    {
        $this->_load();
        return parent::addPaymentTransactions($paymentTransactions);
    }

    public function getPaymentTransactions()
    {
        $this->_load();
        return parent::getPaymentTransactions();
    }

    public function setCurrency(\XLite\Model\Currency $currency)
    {
        $this->_load();
        return parent::setCurrency($currency);
    }

    public function getCurrency()
    {
        $this->_load();
        return parent::getCurrency();
    }

    public function addItem(\XLite\Model\OrderItem $newItem)
    {
        $this->_load();
        return parent::addItem($newItem);
    }

    public function getAddItemError()
    {
        $this->_load();
        return parent::getAddItemError();
    }

    public function getItemByItem(\XLite\Model\OrderItem $item)
    {
        $this->_load();
        return parent::getItemByItem($item);
    }

    public function getItemByItemId($itemId)
    {
        $this->_load();
        return parent::getItemByItemId($itemId);
    }

    public function getItemsByProductId($productId)
    {
        $this->_load();
        return parent::getItemsByProductId($productId);
    }

    public function normalizeItems()
    {
        $this->_load();
        return parent::normalizeItems();
    }

    public function countItems()
    {
        $this->_load();
        return parent::countItems();
    }

    public function countQuantity()
    {
        $this->_load();
        return parent::countQuantity();
    }

    public function isEmpty()
    {
        $this->_load();
        return parent::isEmpty();
    }

    public function isMinOrderAmountError()
    {
        $this->_load();
        return parent::isMinOrderAmountError();
    }

    public function isMaxOrderAmountError()
    {
        $this->_load();
        return parent::isMaxOrderAmountError();
    }

    public function isProcessed()
    {
        $this->_load();
        return parent::isProcessed();
    }

    public function isQueued()
    {
        $this->_load();
        return parent::isQueued();
    }

    public function getItemsWithWrongAmounts()
    {
        $this->_load();
        return parent::getItemsWithWrongAmounts();
    }

    public function getOrigProfile()
    {
        $this->_load();
        return parent::getOrigProfile();
    }

    public function setProfile(\XLite\Model\Profile $profile = NULL)
    {
        $this->_load();
        return parent::setProfile($profile);
    }

    public function setOrigProfile(\XLite\Model\Profile $profile = NULL)
    {
        $this->_load();
        return parent::setOrigProfile($profile);
    }

    public function setProfileCopy(\XLite\Model\Profile $profile)
    {
        $this->_load();
        return parent::setProfileCopy($profile);
    }

    public function getItemsFingerprint()
    {
        $this->_load();
        return parent::getItemsFingerprint();
    }

    public function getDescription()
    {
        $this->_load();
        return parent::getDescription();
    }

    public function getEventFingerprint()
    {
        $this->_load();
        return parent::getEventFingerprint();
    }

    public function getDetail($name)
    {
        $this->_load();
        return parent::getDetail($name);
    }

    public function setDetail($name, $value, $label = NULL)
    {
        $this->_load();
        return parent::setDetail($name, $value, $label);
    }

    public function getMeaningDetails()
    {
        $this->_load();
        return parent::getMeaningDetails();
    }

    public function processSucceed()
    {
        $this->_load();
        return parent::processSucceed();
    }

    public function refreshItems()
    {
        $this->_load();
        return parent::refreshItems();
    }

    public function getPaymentMethods()
    {
        $this->_load();
        return parent::getPaymentMethods();
    }

    public function renewPaymentMethod()
    {
        $this->_load();
        return parent::renewPaymentMethod();
    }

    public function getPaymentMethod()
    {
        $this->_load();
        return parent::getPaymentMethod();
    }

    public function checkItemKeyEqual(\XLite\Model\OrderItem $item, $key)
    {
        $this->_load();
        return parent::checkItemKeyEqual($item, $key);
    }

    public function checkItemIdEqual(\XLite\Model\OrderItem $item, $itemId)
    {
        $this->_load();
        return parent::checkItemIdEqual($item, $itemId);
    }

    public function checkDetailName(\XLite\Model\OrderDetail $detail, $name)
    {
        $this->_load();
        return parent::checkDetailName($detail, $name);
    }

    public function checkPaymentTransactionStatusEqual(\XLite\Model\Payment\Transaction $transaction, $status)
    {
        $this->_load();
        return parent::checkPaymentTransactionStatusEqual($transaction, $status);
    }

    public function isItemProductIdEqual(\XLite\Model\OrderItem $item, $productId)
    {
        $this->_load();
        return parent::isItemProductIdEqual($item, $productId);
    }

    public function checkLastPaymentMethod(\XLite\Model\Payment\Method $pmethod, $lastPaymentId)
    {
        $this->_load();
        return parent::checkLastPaymentMethod($pmethod, $lastPaymentId);
    }

    public function setPaymentMethod($paymentMethod, $value = NULL)
    {
        $this->_load();
        return parent::setPaymentMethod($paymentMethod, $value);
    }

    public function getActivePaymentTransactions()
    {
        $this->_load();
        return parent::getActivePaymentTransactions();
    }

    public function getFirstOpenPaymentTransaction()
    {
        $this->_load();
        return parent::getFirstOpenPaymentTransaction();
    }

    public function getOpenTotal()
    {
        $this->_load();
        return parent::getOpenTotal();
    }

    public function isOpen()
    {
        $this->_load();
        return parent::isOpen();
    }

    public function getPayedTotal()
    {
        $this->_load();
        return parent::getPayedTotal();
    }

    public function isPayed()
    {
        $this->_load();
        return parent::isPayed();
    }

    public function getModifiers()
    {
        $this->_load();
        return parent::getModifiers();
    }

    public function getModifier($type, $code)
    {
        $this->_load();
        return parent::getModifier($type, $code);
    }

    public function isModifierByType($type)
    {
        $this->_load();
        return parent::isModifierByType($type);
    }

    public function getModifiersByType($type)
    {
        $this->_load();
        return parent::getModifiersByType($type);
    }

    public function calculate()
    {
        $this->_load();
        return parent::calculate();
    }

    public function getSurchargesByType($type)
    {
        $this->_load();
        return parent::getSurchargesByType($type);
    }

    public function getSurchargesSubtotal($type = NULL, $include = NULL)
    {
        $this->_load();
        return parent::getSurchargesSubtotal($type, $include);
    }

    public function getSurchargesTotal($type = NULL)
    {
        $this->_load();
        return parent::getSurchargesTotal($type);
    }

    public function prepareEntityBeforeCommit()
    {
        $this->_load();
        return parent::prepareEntityBeforeCommit();
    }

    public function setStatus($value)
    {
        $this->_load();
        return parent::setStatus($value);
    }

    public function getSurchargeSumByType($type)
    {
        $this->_load();
        return parent::getSurchargeSumByType($type);
    }

    public function getSurchargeTotalByType($type)
    {
        $this->_load();
        return parent::getSurchargeTotalByType($type);
    }

    public function map(array $data)
    {
        $this->_load();
        return parent::map($data);
    }

    public function __get($name)
    {
        $this->_load();
        return parent::__get($name);
    }

    public function __set($name, $value)
    {
        $this->_load();
        return parent::__set($name, $value);
    }

    public function __unset($name)
    {
        $this->_load();
        return parent::__unset($name);
    }

    public function getRepository()
    {
        $this->_load();
        return parent::getRepository();
    }

    public function checkCache()
    {
        $this->_load();
        return parent::checkCache();
    }

    public function detach()
    {
        $this->_load();
        return parent::detach();
    }

    public function __call($method, array $args = array (
))
    {
        $this->_load();
        return parent::__call($method, $args);
    }

    public function isPersistent()
    {
        $this->_load();
        return parent::isPersistent();
    }

    public function update()
    {
        $this->_load();
        return parent::update();
    }

    public function create()
    {
        $this->_load();
        return parent::create();
    }

    public function delete()
    {
        $this->_load();
        return parent::delete();
    }

    public function cloneEntity()
    {
        $this->_load();
        return parent::cloneEntity();
    }


    /**
     * __sleep
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __sleep()
    {
        return array('__isInitialized__', 'order_id', 'profile', 'orig_profile', 'shipping_id', 'shipping_method_name', 'tracking', 'date', 'status', 'notes', 'details', 'items', 'surcharges', 'payment_transactions', 'currency', 'total', 'subtotal');
    }

    /**
     * __wakeup
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __wakeup()
    {
        if (isset($this->_identifier)) {
            foreach ($this->_identifier as $k => $v) {
                $this->$k = $v;
            }

            \Xlite\Core\Database::getEM()->getUnitOfWork()->removeFromIdentityMap($this);
            $this->_entityPersister = \XLite\Core\Database::getEM()->getUnitOfWork()->getEntityPersister($this->_entityClass);
        }
    }
}